﻿namespace Guia.Elements.PatternServants
{
    using System;

    /// <summary>
    /// Represents the interface for the SelectionItem-Pattern for single-selection.
    /// </summary>
    public interface ISelectionItemSingle : ISelectionItemSimple
    {
        /// <summary>
        /// Gets or sets a value indicating whether this item is selected or not.
        /// If multiple selection is allowed, this selection causes that only this item may be selected. Thus, other selected items may be unselected. Expect this item doesnt change its value throught the assignment.
        /// </summary>
        /// <exception cref="InvalidOperationException">This exception is thrown when this item can't be selected (e.g. because it is not enabled).</exception>
        new bool IsSelected { get; set; }

        /// <summary>
        /// Unselects this item.
        /// </summary>
        /// <exception cref="InvalidOperationException">This exception is thrown when this item can't be selected/unselected (e.g. because it is not enabled).</exception>
        void Unselect();
    }
}